<template>
  <div class="option-operate-wrap">
    <el-button
      icon="ele-Plus"
      link
      type="primary"
      @click="addDefaultOption"
    >
      {{ $t("formgen.option.addOption") }}
    </el-button>
    <el-button
      v-if="['CHECKBOX', 'RADIO'].indexOf(item.typeId) > -1"
      icon="ele-CirclePlus"
      link
      type="primary"
      @click="addInputOption"
    >
      {{ $t("formgen.option.addOther") }}
    </el-button>
  </div>
</template>
<script setup lang="ts">
import { useFormOption } from "../hooks/useFormOption";

const props = defineProps({
  item: {
    type: Object,
    default: () => {
      return {};
    }
  }
});

const { addDefaultOption, addInputOption } = useFormOption(props);
</script>
<style scoped lang="scss">
.option-operate-wrap {
  margin-top: 20px;
  padding-left: 20px;
}
</style>
